package a.f.h.f.a;

import a.c.*;
import a.c.d;
import a.c.k;
import a.c.n;
import a.f.j.cb;
import a.f.j.r;
import a.f.j.v;
import a.i.t;

public class m
  extends r
  implements g
{
  private boolean q = true;
  private e r = null;
  private ab s = new ab();
  private ab t;
  private k u;
  private boolean v = false;
  private boolean w = false;
  protected k x = null;
  public static int y;
  
  public m()
  {
    c(true);
    d(true);
    this.x = new a.i.p()
    {
      public boolean getBool(Object paramAnonymousObject)
      {
        return false;
      }
    };
    this.h = new t()
    {
      public int getInt(Object paramAnonymousObject)
      {
        if (e.i == 0) {}
        return m.this.x.getBool(paramAnonymousObject) ? 1000 : 1;
      }
    };
    this.g = new p();
    ((p)this.g).b(this.x);
  }
  
  public void c(boolean paramBoolean)
  {
    this.v = paramBoolean;
  }
  
  public boolean k()
  {
    return this.v;
  }
  
  public void d(boolean paramBoolean)
  {
    this.w = paramBoolean;
  }
  
  public boolean l()
  {
    return this.w;
  }
  
  public ab a()
  {
    if ((e.i != 0) || (this.f)) {
      return this.s;
    }
    throw new RuntimeException("Invalid Execution Order: call 'assignUpward' first!");
  }
  
  public a.c.e e()
  {
    if ((e.i != 0) || (this.f)) {
      return this.l;
    }
    throw new RuntimeException("Invalid Execution Order: call 'assignUpward' first!");
  }
  
  public a.c.e d()
  {
    if ((e.i != 0) || (this.f)) {
      return this.m;
    }
    throw new RuntimeException("Invalid Execution Order: call 'assignUpward' first!");
  }
  
  public a.c.m c()
  {
    if ((e.i != 0) || (this.t != null)) {
      return this.t.l();
    }
    return null;
  }
  
  public void a(e parame)
  {
    this.r = parame;
  }
  
  public void a(n paramn)
  {
    this.x = paramn;
  }
  
  public void a(cb paramcb)
  {
    int i = e.i;
    this.d = paramcb;
    this.e = paramcb.a();
    if (i == 0)
    {
      if (this.e.k() != 0)
      {
        if (i != 0) {
          break label134;
        }
        if (this.e.m() != 0) {}
      }
      else
      {
        this.k = new ab();
      }
    }
    else
    {
      this.f = true;
      return;
    }
    this.u = new a.i.p()
    {
      public int getInt(Object paramAnonymousObject)
      {
        return m.this.r.a((d)paramAnonymousObject);
      }
    };
    this.g.a(this.e);
    ((p)this.g).a(this.u);
    this.g.a(f());
    ((p)this.g).b(this.x);
    label134:
    int[] arrayOfInt = new int[this.e.j()];
    v localv = new v(this.e, this.h);
    bb localbb = a(arrayOfInt, localv);
    localv.a(localbb, arrayOfInt);
    this.k = localv.c();
    x localx1 = this.e.B();
    x localx2 = this.e.B();
    a(localx1, localx2, localbb);
    if (i == 0) {
      if (this.w) {
        d(arrayOfInt);
      }
    }
    if ((i != 0) || (this.v)) {
      a(localx1, localx2, localbb, arrayOfInt);
    }
    ab localab1 = new ab(localv.a().iterator());
    ab localab2 = new ab(localv.b().iterator());
    a(localab1, localab2, localx1, localx2, arrayOfInt);
    this.e.a(localx1);
    this.e.a(localx2);
    paramcb.f();
    paramcb.a(paramcb.c(this.i));
    if (i == 0)
    {
      if (this.v) {
        c(arrayOfInt);
      }
      this.f = true;
    }
    i();
  }
  
  protected void h()
  {
    int i = e.i;
    boolean bool = e.h;
    ab localab = new ab(this.e.w());
    a.c.m localm = localab.l();
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald1 = localm.a();
      d locald2 = this.d.a(locald1);
      if (i == 0)
      {
        switch (this.r.a(locald1))
        {
        case 1: 
          this.r.a(locald2, 2);
          if (i != 0) {
            continue;
          }
          if (!bool) {
            break;
          }
        case 2: 
          this.r.a(locald2, 1);
          if (i != 0) {
            continue;
          }
          if (!bool) {
            break;
          }
        case 0: 
          this.r.a(locald2, 0);
        }
        localm.f();
      }
    } while (!bool);
  }
  
  protected void a(ab paramab1, ab paramab2, x paramx1, x paramx2, int[] paramArrayOfInt)
  {
    int j = e.i;
    boolean bool = e.h;
    x localx1 = this.e.B();
    x localx2 = this.e.B();
    a(paramab1, localx1);
    a(paramab2, localx2);
    h();
    this.b.a(paramArrayOfInt);
    this.c.a(paramArrayOfInt);
    w localw = this.e.v();
    label276:
    label323:
    label759:
    do
    {
      if (!localw.e()) {
        break;
      }
      a.c.e locale = localw.d();
      ab localab3 = new ab();
      Object localObject1 = null;
      Object localObject2 = null;
      int i = 0;
      ab localab1 = (ab)localx1.get(locale);
      if (bool) {
        return;
      }
      if (j == 0) {
        if (localab1 != null)
        {
          this.b.a(locale);
          localab1.a(this.b);
        }
      }
      ab localab2 = (ab)localx2.get(locale);
      if (j == 0) {
        if (localab2 != null)
        {
          this.c.a(locale);
          localab2.a(this.c);
        }
      }
      d locald = (d)paramx1.get(locale);
      if ((j != 0) || (locald != null))
      {
        if (locald.e() == locale)
        {
          localab3.add(locald);
          if (j != 0) {
            break label276;
          }
          if (!bool) {}
        }
        else
        {
          localab3.add(this.d.b(locald));
        }
        if (j == 0) {
          if (this.u.getInt(locald) == 1)
          {
            localObject1 = locald;
            break label323;
          }
        }
        if ((j != 0) || (this.u.getInt(locald) == 2)) {
          localObject1 = this.d.b(locald);
        }
      }
      a.c.m localm;
      if ((j != 0) || (localab1 != null))
      {
        localm = localab1.l();
        do
        {
          if (!localm.e()) {
            break;
          }
          locald = localm.a();
          if (bool) {
            break label658;
          }
          if (locald.e() == locale)
          {
            localab3.add(locald);
            if ((j == 0) && (!bool)) {}
          }
          else
          {
            localab3.add(this.d.b(locald));
          }
          if (locale == this.j)
          {
            if (j != 0) {
              break label441;
            }
            if (this.i == null) {
              this.i = ((d)localab3.d());
            }
          }
          if (j == 0)
          {
            if (this.u.getInt(locald) == 1)
            {
              if (j == 0) {
                if ((locale == locald.f()) && ((j != 0) || (localObject1 == null))) {
                  localObject1 = locald;
                }
              }
              if (locale == locald.e()) {
                if ((j != 0) || (localObject2 == null))
                {
                  localObject2 = locald;
                  if (j != 0) {
                    continue;
                  }
                  if (!bool) {}
                }
              }
            }
            else
            {
              if (j != 0) {
                continue;
              }
            }
          }
          else if (this.u.getInt(locald) == 2)
          {
            if (j == 0) {
              if ((locale == locald.e()) && ((j != 0) || (localObject1 == null))) {
                localObject1 = this.d.b(locald);
              }
            }
            if (locale == locald.f()) {
              if ((j != 0) || (localObject2 == null)) {
                localObject2 = this.d.b(locald);
              }
            }
          }
          localm.f();
        } while (!bool);
      }
      locald = (d)paramx2.get(locale);
      if (j == 0)
      {
        if ((j == 0) && (locald == null)) {
          break label797;
        }
        if (locald.e() == locale)
        {
          localab3.add(locald);
          if ((this.u.getInt(locald) != 1) || ((j == 0) && (localObject2 != null))) {
            break label759;
          }
          localObject2 = locald;
          if (j == 0) {
            if (!bool) {
              break label759;
            }
          }
        }
        else
        {
          localab3.add(this.d.b(locald));
        }
      }
      do
      {
        if ((this.u.getInt(locald) == 2) && ((j != 0) || (localObject2 == null))) {
          localObject2 = this.d.b(locald);
        }
        if (locale == this.j)
        {
          if (j == 0)
          {
            if (j != 0) {
              break;
            }
            if (this.i != null) {
              break label797;
            }
          }
          this.i = ((d)localab3.d());
        }
        if (localab2 != null)
        {
          localm = localab2.l();
          do
          {
            if (!localm.e()) {
              break label1087;
            }
            locald = localm.a();
            if (bool) {
              break;
            }
            if (locald.e() == locale)
            {
              localab3.add(locald);
              if ((j == 0) && (!bool)) {}
            }
            else
            {
              localab3.add(this.d.b(locald));
            }
            if (locale == this.j)
            {
              if (j != 0) {
                break label910;
              }
              if (this.i == null) {
                this.i = ((d)localab3.d());
              }
            }
            if (j == 0)
            {
              if (this.u.getInt(locald) == 1)
              {
                if (localObject2 == null)
                {
                  if (j != 0) {
                    break label960;
                  }
                  if (locale == locald.e()) {
                    localObject2 = locald;
                  }
                }
                if (locale == locald.f())
                {
                  if (j != 0) {
                    continue;
                  }
                  if (i == 0)
                  {
                    localObject1 = locald;
                    i = 1;
                    if (j != 0) {
                      continue;
                    }
                    if (!bool) {}
                  }
                }
              }
              else
              {
                if (j != 0) {
                  continue;
                }
              }
            }
            else if (this.u.getInt(locald) == 2)
            {
              if (localObject2 == null)
              {
                if (j != 0) {
                  break label1048;
                }
                if (locale == locald.f()) {
                  localObject2 = this.d.b(locald);
                }
              }
              if (locale == locald.e())
              {
                if (j != 0) {
                  continue;
                }
                if (i == 0)
                {
                  localObject1 = this.d.b(locald);
                  i = 1;
                }
              }
            }
            localm.f();
          } while (!bool);
        }
      } while (j != 0);
      this.r.a(locale, localObject1 == null ? null : this.d.b((d)localObject1));
      this.r.c(locale, (d)localObject2);
      this.a.a(localab3);
      locale.b(this.a);
      localw.f();
    } while (!bool);
    label441:
    label960:
    this.e.a(localx1);
    label658:
    label797:
    label1087:
    if (j == 0) {
      this.e.a(localx2);
    }
    label910:
    label1048:
    return;
  }
  
  private void a(x paramx1, x paramx2, bb parambb, int[] paramArrayOfInt)
  {
    int j = e.i;
    boolean bool = e.h;
    boolean[] arrayOfBoolean1 = new boolean[this.e.k()];
    boolean[] arrayOfBoolean2 = new boolean[this.e.k()];
    int i = 0;
    do
    {
      do
      {
        if (i >= this.e.k()) {
          break;
        }
        arrayOfBoolean1[i] = true;
        arrayOfBoolean2[i] = true;
        i++;
        if ((j == 0) && (bool)) {
          break label222;
        }
      } while (!bool);
      if (j != 0) {
        break;
      }
    } while (j != 0);
    if (this.q)
    {
      localObject1 = this.e.w();
      do
      {
        if (!((a.c.m)localObject1).e()) {
          break;
        }
        localObject2 = ((a.c.m)localObject1).a();
        if (j == 0)
        {
          if (paramArrayOfInt[localObject2.e().f()] < paramArrayOfInt[localObject2.f().f()])
          {
            arrayOfBoolean1[localObject2.f().f()] = false;
            arrayOfBoolean2[localObject2.e().f()] = false;
            if (j != 0) {
              continue;
            }
            if (!bool) {}
          }
          else
          {
            arrayOfBoolean1[localObject2.e().f()] = false;
          }
        }
        else {
          arrayOfBoolean2[localObject2.f().f()] = false;
        }
        ((a.c.m)localObject1).f();
      } while (!bool);
    }
    label222:
    Object localObject1 = parambb.l();
    Object localObject2 = ((w)localObject1).d();
    ((w)localObject1).f();
    do
    {
      if (!((w)localObject1).e()) {
        break;
      }
      Object localObject3 = localObject2;
      localObject2 = ((w)localObject1).d();
      if (j == 0)
      {
        if (paramx1.get(localObject2) == null) {
          if ((j != 0) || (arrayOfBoolean2[localObject3.f()] == 0))
          {
            if (j != 0) {
              continue;
            }
            if (arrayOfBoolean1[localObject2.f()] == 0) {}
          }
          else
          {
            d locald = this.e.a(localObject3, (a.c.e)localObject2);
            this.d.o(locald);
            paramx1.a(localObject2, locald);
            paramx2.a(localObject3, locald);
            this.r.a(locald, 1);
            this.s.add(locald);
          }
        }
        ((w)localObject1).f();
      }
    } while (!bool);
  }
  
  public void c(int[] paramArrayOfInt)
  {
    int j = e.i;
    boolean bool = e.h;
    int i = this.e.k();
    w localw = this.e.v();
    if (j == 0) {
      if (localw.k() == 1) {
        return;
      }
    }
    label128:
    do
    {
      if (!localw.e()) {
        break;
      }
      a.c.e locale = localw.d();
      if (j == 0)
      {
        if (paramArrayOfInt[locale.f()] != 1)
        {
          if (j != 0) {
            break label128;
          }
          if (locale.d() == 0) {
            throw new RuntimeException("Node " + locale + " is an invalid source!");
          }
        }
        if (j != 0) {}
      }
      else
      {
        if (paramArrayOfInt[locale.f()] != i)
        {
          if (j != 0) {
            continue;
          }
          if (locale.e() == 0) {
            throw new RuntimeException("Node " + locale + " is an invalid sink!");
          }
        }
        localw.f();
      }
    } while (!bool);
  }
  
  private void d(int[] paramArrayOfInt)
  {
    int i = e.i;
    boolean bool = e.h;
    this.t = new ab();
    a.c.m localm = this.e.w();
    label124:
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      if (i == 0)
      {
        if (this.r.a(locald) == 0)
        {
          if (i == 0)
          {
            this.t.add(locald);
            if (paramArrayOfInt[locald.e().f()] < paramArrayOfInt[locald.f().f()])
            {
              this.r.a(locald, 1);
              if (i != 0) {
                continue;
              }
              if (!bool) {
                break label124;
              }
            }
          }
          this.r.a(locald, 2);
        }
        localm.f();
      }
    } while (!bool);
  }
  
  public void i() {}
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.h.f.a.m

 * JD-Core Version:    0.7.0.1

 */